package com.srit.migration.business.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

import com.srit.base.bean.Page;
import com.srit.base.dao.SqlMapDao;
import com.srit.migration.business.bean.DbType;
import com.srit.migration.business.dao.DbTypeDao;

/**
 * @author guan
 * @by daoImpl.tem
 * 
 */
 @Service
public class DbTypeDaoImpl implements DbTypeDao {
	@Autowired(required = true)
	private SqlMapDao sqlMapDao;

	@Override
	public void save(DbType dbType) {
		sqlMapDao.save("DbType.save", dbType);
	}

	@Override
	public void update(DbType dbType) {
		sqlMapDao.update("DbType.save", dbType);
	}

	@Override
	public DbType getById(DbType dbType) {
		return (DbType) sqlMapDao.getById("DbType.getById", dbType.getId());
	}

	@Override
	public void delete(DbType dbType) {
		sqlMapDao.delete("DbType.delete", dbType);
	}

	@Override
	public void page(Page page) {
		sqlMapDao.queryForObject("DbType.page", page);
	}
	
	@Override
	public void batchSave(List<DbType> dbTypeList) {
		sqlMapDao.batchSave("DbType.batchSave", dbTypeList);

	}

	@Override
	public List list(Page page) {
		return sqlMapDao.queryForList("DbType.list", page);

	}

}
